var fs = require("fs");
var buf = new Buffer(1024);

console.log("准备打开文件！");


var sheng = ['b', 'p', 'm', 'f', 'd', 't', 'n', 'l',
    'g', 'k', 'h',
    'j', 'q', 'x',
    'zh', 'ch', 'sh', 'r',
    'z', 'c', 's'
];
var yun = ['a', 'o', 'e', 'u', 'i',
    'ai', 'ei', 'ui',
    'ao', 'ou', 'an', 'en', 'ang', 'eng', 'ong', 'un', 'in', 'ing',
    'iu', 'iao', 'ian', 'iang', 'uang', 'uan', 'iong', 'ue', 'ua', 'uo'];

var zi = [];
var num = ['' , '123', '1234', '111', '1111', '666', '888', '8888', '999', '0000'];
for (var i in sheng) {
    for (var j in yun) {
        zi.push(sheng[i] + yun[j]);
    }
}
var data = '';
for (var i = 0; i < zi.length; i++) {
    for (var j = 0; j < zi.length; j++) {
        for (var k = 0; k < num.length; k++) {
            data = data + zi[i] + zi[j] + num [k] + '\n';
        }
    }
}
var filename = "code.txt";
var callback = function () {
    console.log("callback exe...");
};

fs.writeFile(filename, data, callback);
